using System;
using System.Collections.Generic;
using System.Text;

namespace ASMdll
{
	internal static class ZeroOperandsTranslator
	{

		public static Byte[] ParseNOP(ref bool needWriteMemory, ref int byteIndToWriteMemory,  ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = 0x90;
			return code;
		}

		public static Byte[] ParsePUSH(ref bool needWriteMemory, ref int byteIndToWriteMemory, ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = (Byte)((9 << 4) | 12);
			return code;
		}

		public static Byte[] ParsePOP(ref bool needWriteMemory, ref int byteIndToWriteMemory, ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = (Byte)((9 << 4) | 13);
			return code;
		}

		public static Byte[] ParseRET(ref bool needWriteMemory, ref int byteIndToWriteMemory, ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = (Byte)((12 << 4) | 3);
			return code;
		}

		public static Byte[] ParseCBW(ref bool needWriteMemory, ref int byteIndToWriteMemory, ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = (Byte)((9 << 4) | 8);
			return code;
		}

		public static Byte[] ParseCWD(ref bool needWriteMemory, ref int byteIndToWriteMemory, ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = (Byte)((9 << 4) | 9);
			return code;
		}

		public static Byte[] ParsePUSHF(ref bool needWriteMemory, ref int byteIndToWriteMemory, ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = (Byte)((9 << 4) | 12);
			return code;
		}

		public static Byte[] ParsePOPF(ref bool needWriteMemory, ref int byteIndToWriteMemory, ref bool needWriteD8, ref int byteToWriteD8, ref bool needWriteD16, ref int byteToWriteD16)
		{
			Byte[] code;
			needWriteMemory = false;
			byteIndToWriteMemory = -1;
			needWriteD8 = false;
			byteToWriteD8 = -1;
			needWriteD16 = false;
			byteToWriteD16 = -1;
			code = new Byte[1];
			code[0] = (Byte)((9 << 4) | 13);
			return code;
		}
	}
}
